package com.syg.SpringMVC._01_SpringMVC_XML;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 处理器
 */
public class _01_SpringMVC_XML implements Controller{

    /**
     * 这里面只能有一个方法吗？如果有多个方法怎么处理？
     * @param httpServletRequest
     * @param httpServletResponse
     * @return
     * @throws Exception
     */
    @Override
    public ModelAndView handleRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("Message","这是我的第一个SpringXML程序");
        modelAndView.setViewName("JspPage/_01_SpringMVC_XML/_01_SpringMVC_XML.jsp");
        return modelAndView;
    }
}
